package com.ssy.lingxi.member.merchant.controller.mobile;

import com.ssy.lingxi.common.response.PageData;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.model.vo.comment.request.OrderProductTradeCommentQueryVO;
import com.ssy.lingxi.member.merchant.model.vo.comment.request.OrderProductTradeCommentVO;
import com.ssy.lingxi.member.merchant.model.vo.comment.response.ProductOrderTradeCommentPageVO;
import com.ssy.lingxi.member.merchant.model.vo.maintenance.response.MemberDetailCreditCommentSummaryVO;
import com.ssy.lingxi.member.merchant.service.web.IMemberCommentService;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @menu App - 现货商品评价
 * @author 万宁、姚梓聪
 * @version 2.0.0
 * @date 2020-10-23
 */
@RestController
@RequestMapping("/member/mobile/comment")
public class MobileMemberCommentMallController {
    @Resource
    private IMemberCommentService memberCommentService;

    /**
     * 商城能力-店铺渠道商城-现货商品详情-商户总体满意度
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/mall/trade/summary", method = RequestMethod.GET)
    public Wrapper<MemberDetailCreditCommentSummaryVO> pageOrderProductTradeCommentSummary(@RequestHeader HttpHeaders headers, @Valid OrderProductTradeCommentVO pageVO) {
        return memberCommentService.pageOrderProductTradeCommentSummary(pageVO);
    }

    /**
     * 商城能力-店铺渠道商城-现货商品详情-交易评价分页列表
     * @param headers Http头部信息
     * @param pageVO 接口参数
     * @return 查询结果
     */
    @RequestMapping(value = "/mall/trade/history/page", method = RequestMethod.GET)
    public Wrapper<PageData<ProductOrderTradeCommentPageVO>> pageOrderProductTradeCommentHistory(@RequestHeader HttpHeaders headers, @Valid OrderProductTradeCommentQueryVO pageVO) {
        return memberCommentService.pageOrderProductTradeCommentHistory(pageVO);
    }
}
